package cn.smile.controller.home;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import cn.smile.bean.PageBean;
import cn.smile.entity.common.WantedGoods;
import cn.smile.service.common.WantedGoodsService;

import javax.annotation.Resource;

/**
 * 求购物品控制器
 *
 * @author Administrator
 */
@RequestMapping("/home/wanted_goods")
@Controller
public class HomeWantedGoodsController {

    @Resource
    private WantedGoodsService wantedGoodsService;

    /**
     * 求购物品列表页面
     */
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public String list(Model model, PageBean<WantedGoods> pageBean, WantedGoods WantedGoods) {
        model.addAttribute("pageBean", wantedGoodsService.findlist(pageBean, WantedGoods));
        return "home/wanted_goods/list";
    }
}
